﻿using System;

namespace XZTZ.UMP.Public.Common
{
    public class PublicMethod
    {
        public static string Arabia_to_Chinese(int Num)
        {
            decimal num = Num;
            Num = Math.Abs(Num);
            string str = Num.ToString();
            string str2 = "";
            char[] chArray = str.ToCharArray();
            for (int i = chArray.Length - 1; i >= 0; i--)
            {
                if (chArray.Length > 8)
                {
                    return "位数过大，无法计算";
                }
                char ch = chArray[i];
                switch (ch)
                {
                    case '0':
                        str2 = "○" + str2;
                        break;

                    case '1':
                        str2 = "一" + str2;
                        break;

                    case '2':
                        str2 = "二" + str2;
                        break;

                    case '3':
                        str2 = "三" + str2;
                        break;

                    case '4':
                        str2 = "四" + str2;
                        break;

                    case '5':
                        str2 = "五" + str2;
                        break;

                    case '6':
                        str2 = "六" + str2;
                        break;

                    case '7':
                        str2 = "七" + str2;
                        break;

                    case '8':
                        str2 = "八" + str2;
                        break;

                    case '9':
                        str2 = "九" + str2;
                        break;
                }
                if ((i == 0) && (chArray.Length == 2))
                {
                    if (ch != '1')
                    {
                        str2 = str2.Substring(0, 1) + "十" + str2.Substring(1);
                    }
                    else
                    {
                        str2 = "十" + str2.Substring(1);
                    }
                }
            }
            if (str2.Equals("十○"))
            {
                str2 = "十";
            }
            if (num < 0M)
            {
                str2 = "负" + str2;
            }
            return str2;
        }

       
    }
}
